﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
using KPIS.GERP.GBMS.BLL;

public partial class ExpensePanel : System.Web.UI.UserControl
{
    private ComboBLL comboBLL = new ComboBLL();
    public string seq;
    protected void Page_Load(object sender, EventArgs e)
    {
        //lblNum.Text = Session["num"].ToString();
        //Response.Write(seq);
        RadTreeView tree = (RadTreeView)ddlResource_t3.Items[0].FindControl("TreeViewResource");
        LoadRootNodes(tree, TreeNodeExpandMode.ServerSideCallBack);
    }

    private void LoadRootNodes(RadTreeView treeView, TreeNodeExpandMode expandMode)
    {
        foreach (DataRow info in comboBLL.ListResourcTree("").Rows)
        {

            RadTreeNode node = new RadTreeNode();
            node.Text = info["NAME"].ToString();
            node.Category = info["Category"].ToString();
            //node.ToolTip = info.Descr;
            node.Value = info["ID"].ToString();
            node.ImageUrl = info["IMAGE_URL"].ToString();
            node.Checkable = false;
            if (Convert.ToInt32(info["Children_count"]) > 0)
            {
                node.ExpandMode = expandMode;
            }
            treeView.Nodes.Add(node);
        }
    }

    private void SaveData()
    { 
    
    }
}